<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %>
<!DOCTYPE html>
<%
    String path = request.getContextPath();
    String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort() + path;
%>
<html>
<body>
<h2>welcome!</h2>
<input type="button" value="爬虫抓取" id="test">
</body>
</html>
<script src="<%=basePath%>/resources/jquery-1.9.1.js"></script>
<script>
    var basePath='<%=basePath%>';
    $(function () {

    });
    $("#test").on('click',function () {
        test();
    });
    function test() {
        var url=basePath+'/collectorController/executeCollector';
        $.post(url,{},function (data) {
            console.log("测试数据返回:",data);
        },'json')
    }
    function test1() {
        var url=basePath+'/collectorController/demoTest';
        $.post(url,{},function (data) {
            console.log("测试数据返回:",data);
        },'json')
    }
</script>
